翻訳と辞書
Words near each other
・ Reduncinae
・ Redundancy
・ Redundancy (engineering)
・ Redundancy (information theory)
・ Redundancy (linguistics)
・ Redundancy in United Kingdom law
・ Redundancy Payments Act 1965
・ Redundancy problem
・ Redundancy theory of truth
・ Redundant (play)
・ Redundant (song)
・ Redundant array of independent memory
・ Redundant Array of Inexpensive Servers
・ Redundant binary representation
・ Redundant church
Redundant code
・ Redundant proof
・ Reduplicated plural
・ Reduplication
・ Reduplication in the Russian language
・ Reduplicative paramnesia
・ Reduta
・ Reduta Jazz Club
・ Reduta Theatre
・ Reduto
・ Reduty
・ Reduviidae
・ Reduviinae
・ Reduvius
・ Reduvius personatus


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Redundant code : ウィキペディア英語版
Redundant code
In computer programming, redundant code is source code or compiled code in a computer program that is unnecessary, such as recomputing a value that has previously been calculated〔(Debray, S. K., Evans, W., Muth, R., and De Sutter, B. 2000. Compiler techniques for code compaction. ACM Trans. Program. Lang. Syst. 22, 2 (Mar. 2000), 378–415. )〕 and is still available, code that is never executed (known as unreachable code), or code which is executed but has no external effect (e.g., does not change the output produced by a program; known as dead code).
A NOP instruction might be considered to be redundant code that has been explicitly inserted to pad out the instruction stream or introduce a time delay, for example to create a timing loop by "wasting time". Identifiers that are declared, but never referenced, are termed redundant declarations.
==Examples==

int foo(int iX)

The second iX
*2
expression is redundant code and can be replaced by a reference to the variable iY. Alternatively, the definition int iY = iX
*2
can instead be removed.
Consider:

#define min(A,B) ((A)<(B)?(A):(B))
int shorter_magnitude(int u1, int v1, int u2, int v2)

As a consequence of using the C preprocessor, the compiler will only witness the expanded form:

int shorter_magnitude(int u1, int v1, int u2, int v2)

Because the use of min/max macros is very common, modern compilers are trained to recognize and eliminate redundancy caused by their use.
There is ''no'' redundancy, however, in the following code:

#define max(A,B) ((A)>(B)?(A):(B))
int random(int cutoff, int range)

The reason is that its implementation is incorrect. If the initial call to rand(), modulo range, is greater than or equal to cutoff, rand() will be called a second time for a second computation of rand()%range, which may result in a value that is actually lower than the cutoff. The max macro will thus not work for this function.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Redundant code」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.